/*    */ package com.zimbra.cs.account.callback;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import com.zimbra.cs.account.AttributeCallback;
/*    */ import com.zimbra.cs.account.Entry;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class FeatureCalendarEnabled
/*    */   extends AttributeCallback
/*    */ {
/*    */   public void preModify(CallbackContext context, String attrName, Object attrValue, Map attrsToModify, Entry entry)
/*    */     throws ServiceException
/*    */   {}
/*    */   
/*    */   public void postModify(CallbackContext context, String attrName, Entry entry)
/*    */   {
/* 42 */     ZimbraLog.misc.debug("attrName: %s", new Object[] { attrName });
/* 43 */     if ("zimbraFeatureCalendarEnabled".equals(attrName)) {
/* 44 */       if (context.isDoneAndSetIfNot(AccountStatus.class)) {
/* 45 */         return;
/*    */       }
/* 47 */       Boolean isCalendarEnabled = Boolean.valueOf(entry.getAttr("zimbraFeatureCalendarEnabled"));
/* 48 */       if (!isCalendarEnabled.booleanValue()) {
/* 49 */         Map<String, String> attrs = new HashMap();
/* 50 */         attrs.put("zimbraFeatureGroupCalendarEnabled", "FALSE");
/* 51 */         attrs.put("zimbraFeatureCalendarReminderDeviceEmailEnabled", "FALSE");
/*    */         try {
/* 53 */           Provisioning.getInstance().modifyAttrs(entry, attrs);
/* 54 */           ZimbraLog.misc.debug("zimbraFeatureGroupCalendarEnabled and zimbraFeatureCalendarReminderDeviceEmailEnabled set to false as zimbraFeatureCalendarEnabledis also set to false.");
/*    */         }
/*    */         catch (ServiceException e) {
/* 57 */           ZimbraLog.misc.error("Unable to set zimbraFeatureGroupCalendarEnabled or zimbraFeatureCalendarReminderDeviceEmailEnabled", e);
/*    */         }
/*    */       }
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/callback/FeatureCalendarEnabled.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */